import React from 'react';
import { Column } from '@ant-design/plots';
const MajorComparison: React.FC<any> = () => {
  const data = [
    {
      class: '电气2201',
      GPA: 3.8,
    },
    {
      class: '电气2202',
      GPA: 3.2,
    },
    {
      class: '电气2203',
      GPA: 3.4,
    },
    {
      class: '电气2204',
      GPA: 2.9,
    },
    {
      class: '电气2205',
      GPA: 3.7,
    },
    {
      class: '电气2206',
      GPA: 2.1,
    },
    {
      class: '电气2207',
      GPA: 3.4,
    },
    {
      class: '电气2208',
      GPA: 3.8,
    },
  ];
  const config = {
    data,
    xField: 'class',
    yField: 'GPA',
    label: {
      // 可手动配置 label 数据标签位置
      position: 'middle',
      // 'top', 'bottom', 'middle',
      // 配置样式
      style: {
        fill: '#FFFFFF',
        opacity: 0.6,
      },
    },
    xAxis: {
      label: {
        autoHide: true,
        autoRotate: false,
      },
    },
    meta: {
      type: {
        alias: '类别',
      },
      sales: {
        alias: '绩点',
      },
    },
  };
  return <Column {...config} />;
};
export default MajorComparison;
